<template>
	<view>
		<v-pull-up-refresh @refresh="handleRefresh">
			<view v-for="item in list" :key="item.id">
				{{ item.text }}
			</view>
		</v-pull-up-refresh>
	</view>
</template>

<script lang="ts" setup>
import { ref } from 'vue';

const list = ref([
	{ id: 1, text: 'Item 1' },
	{ id: 2, text: 'Item 2' },
	{ id: 3, text: 'Item 3' }
]);

const handleRefresh = (done: () => void) => {
	setTimeout(() => {
		list.value = [{ id: 0, text: 'New Item' }, ...list.value];
		done();
	}, 1000);
};
</script>
